<?php
/**
 * -----------------------------------------------------
 *
 * libraries/sys_message
 *
 * @package     class
 * @subpackage  
 * @category    信息返回处理类
 * @author      ChenFu
 * @since       2015-8-4 version 1.0       
 * -----------------------------------------------------    
 */
class Sys_message
{
  	private $CI;
  	public function __construct(){
  		$this->CI =& get_instance();
  		$this->CI->load->helper('url');
  	}

    /**
     * [success 返回成功提示信息,单个数据]
     * @return [type] [json]
     */
    public function asuccess($arr){
      $obj['retcode']     = "000000";
      $obj['retinfo']     = "成功";
      $obj['doc']         = $arr;
      $data = json_encode($obj);
      exit($data);
    }
    /**
     * [success 返回成功提示信息]
     * @return [type] [json]
     */
    public function success(){
      $obj['retcode']     = "000000";
      $obj['retinfo']     = "成功";
      $data = json_encode($obj);
      exit($data);
    }


    /**
     * [error 返回错误提示信息]
     * @return [type] [json]
     */
    public function error($error){
      $obj['retcode']   = '000001';
      $obj['retinfo']   = '失败';
      $data = json_encode($obj);
      exit($data);
    }



    /**
     * [error 返回错误提示信息]
     * @return [type] [json]
     */
    public function errormsg($error){
      $obj['retcode']   = '000001';
      $obj['retinfo']   = $error;
      $data = json_encode($obj);
      exit($data);
    }



}